﻿using HotelManagerDAL.HotelDAL;
using HotelManagerModel.HotelModel;
using System;


namespace HotelManagerBLL.HotelBLL
{
    /// <summary>
    /// 管理员登录
    /// </summary>
    public class ManagerBLL
    {
        #region 返回HotelManager对象

        /// <summary>
        /// 返回Manager对象
        /// </summary>
        /// <param name="loginName">登录名</param>
        /// <param name="loginPass">密码</param>
        /// <returns></returns>
        public HotelManager GetHotelManager(string loginId, string loginPwd)
        {
            try
            {
                return ManagerDAL.GetHotelManager(loginId, loginPwd);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }

        #endregion

        #region 更新管理员密码

        /// <summary>
        /// 更新管理员密码
        /// </summary>
        /// <param name="manager">管理员对象</param>
        /// <returns>大于0：修改成功 小于0：修改失败</returns>
        public int UpdatePassById(HotelManager manager)
        {
            try
            {
                return ManagerDAL.UpdatePassById(manager);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        #endregion
    }
}
